<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>添加专题</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__STATIC__/css/font-awesome.min.css" rel="stylesheet">
    <link href="__STATIC__/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/css/style.css" rel="stylesheet">
    <!--表单元素css-->
    <link href="__STATIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>
<body class="fixed-sidebar full-height-layout gray-bg">
<div id="wrapper">
    <!--左侧导航开始-->
    <include file="Public/left" title="left" />
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1" style="height: auto;">
        <include file="Public/top" title="top" />
        <div class="row J_mainContent" id="content-main">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>应用管理</h5>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="{:U('Download/update')}" id="signupform"   class="form-horizontal">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">ID</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" readonly="readonly"  name="id"  value="{$post.id}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">购买次数</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  name="downum" value="{$post.downum}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">赠送次数</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  name="giftsnum"  value="{$post.giftsnum}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">购买金额</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  name="price"  value="{$post.price}">
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">版本级别名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"   name="remarks" value="{$post.remarks}">
                                </div>
                            </div>
                                <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否展示</label>
                                <div class="col-sm-10">
                                    <if condition="$post.isshow eq  1">
                                        <input type="checkbox" class="i-checks"  value="1"  checked="checked" name="isshow" value="{$post.isshow}">
                                        <else/>
                                        <input type="checkbox" class="i-checks"  value="1"   name="isshow" value="{$post.isshow}">
                                    </if>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button type="submit" class="btn btn-info" id="submit">更新</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--右侧部分结束-->

</body>

</html>
<!-- 全局js -->
<script src="__STATIC__/js/jquery.min.js"></script>
<script src="__STATIC__/js/bootstrap.min.js"></script>
<script src="__STATIC__/js/laydate/laydate.js"></script>
<script src="__STATIC__/js/content.js"></script>
<script src="__STATIC__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__STATIC__/js/plugins/validate/jquery.validate.js"></script>
<script src="__STATIC__/js/plugins/validate/messages_zh.js"></script>

<script>
    $(document).ready(function() {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>
<script type="text/javascript">

    $.validator.setDefaults({
        submitHandler: function () {
            document.getElementById("signupform").submit();

        }
    })
    $().ready(function () {
        $("#signupform").validate({
            rules: {
                downum: {
                    required: true,
                    digits:true ,
                    min: 0 ,


                },
                giftsnum: {
                    digits:true ,

                },
                price: {
                    required: true,
                    number:true,
                    min: 0 ,
                },
                remarks: {
                    required: true,
                    minlength: 1,
                    maxlength: 12.

                },
            },
            messages: {
                downum: {
                    required: "请输入下载次数",
                    digits: "只能输入整数",
                    min:$.validator.format("请输入一个最小为 {0} 的值"),

                },
                giftsnum: {
                    digits: "只能输入整数",

                },
                price: {
                    number: "请输入合法的金额",
                    min:$.validator.format("请输入一个最小为 {0} 的值"),
                },
                remarks: {
                    required: "请输入级别版本",
                    minlength: "最少输入{0}个字符",
                    maxlength: "最多输入{0}个字符"
                },
            },


        });
    });

</script>